#include "Method.h"
#include "Class.h"
Method::Method(Image* image,string selector,Class* cls=NULL){
   Method::image=image;
   if(image->clsMethod!=NULL){
       image->clsMethod->initializeObject(this);
   }
   Method::selector=selector;
   if(cls!=NULL){
        cls->addMethod(this);
   }
}
string Method::getSelector(){
   return selector;
} 

Object* primitive_method_get_selector(Image* image,Object* self,int argc,Object** argv){
    return makeString(image,(char*)((Method*)self)->getSelector().c_str());
}